﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LeEdu.DAL.DataAccess
{
    using ServiceStack.OrmLite;

    /// <summary>
    /// 命名策略
    /// 表名小写，可自定义表名、列表前缀
    /// </summary>
    public class PrefixLowercaseNamingStrategy : OrmLiteNamingStrategyBase
    {
        public string TablePrefix { get; set; }
        public string ColumnPrefix { get; set; }

        public override string GetTableName(string name)
        {
            return TablePrefix + name.ToLower();
        }

        public override string GetColumnName(string name)
        {
            return ColumnPrefix + name;
        }
    }
}
